
#coding:utf-8
#用户获取百度短网址
import http_request_ssl
import json

__url = "http://dwz.cn/create.php"
__back_url = "http://dwz.cn/query.php"
def get_dwz(origin_url):
    http_req = http_request_ssl.http_request_ssl(__url)
    data = {
        "url":origin_url
    }
    response= http_req.do_post(data)
    data = json.loads(response)
    return data

def get_origin_url(dwz):
    http_req = http_request_ssl.http_request_ssl(__back_url)
    data = {
        "tinyurl":dwz
    }
    response= http_req.do_post(data)
    data = json.loads(response)
    return data

